1 using System;
2 using
UnityEngine;
3
4 namespace
UnityStandardAssets.Effects
5 {
6     
public class ParticleSystemMultiplier : MonoBehaviour
7     {
8         
// a simple script to scale the size, speed and lifetime of a particle system
9
10         
public float multiplier = 1;
11
12
13         
private void Start()
14         {
15             
var systems = GetComponentsInChildren<ParticleSystem>();
16             
foreach (ParticleSystem system in systems)
17             {
18                 ParticleSystem.MainModule mainModule = system.main;
19                 mainModule.startSizeMultiplier *= multiplier;
20                 mainModule.startSpeedMultiplier *= multiplier;
21                 mainModule.startLifetimeMultiplier *= Mathf.Lerp(multiplier,
1, 0.5f);
22                 system.Clear();
23                 system.Play();
24             }
25         }
26     }
27 }


Gõ tìm kiếm nhanh...